export let login = {
  namespaced: true,
  state: {
    login_data: {},
  },
  actions: {
    getLoginData(store, data = {}) {
      let url = "/login/cellphone?phone=" + data.phone + "&password=" + data.password + "&countrycode=" + data.countrycode;

      return new Promise((resolve, reject) => {
        axios.get(url).then(({
          data
        }) => {
          store.commit("setLoginData", data);
          resolve(data);
        }).catch(()=>{
            reject()
        });
      })
    },
  },
  mutations: {
    setLoginData(state, data) {
      state.login_data = data;
    },
  }
}
